<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:lang('_SNS_BACKSTAGE_MANAGE_')}</title>
    <link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__favicon.ico" media="screen" />
    <!--OC 自定义样式-->
    {load href="/admin/static/css/oc.css" /}
    <!--OC 自定义样式 end-->
    {load href="/static/os-icon/simple-line-icons.min.css" /}
    {load href="/admin/static/css/oc/admin.css" /}
    <!--adminlte-->
    {load href="/admin/static/adminlte/bootstrap/css/bootstrap.min.css" /}
    {load href="/admin/static/adminlte/dist/css/AdminLTE.min.css" /}
    {load href="/admin/static/adminlte/dist/css/skins/_all-skins.min.css" /}

    <!-- iCheck -->
    {load href="/admin/static/adminlte/plugins/iCheck/flat/blue.css" /}
    {load href="/admin/static/bootstrap/plugins/font-awesome/css/font-awesome.min.css" /}
    {load href="/admin/static/bootstrap/plugins/simple-line-icons/simple-line-icons.min.css" /}
    {load href="/admin/static/bootstrap/css/components.min.css" /}

    {load href="/admin/static/css/adminlte.css" /}
    {load href="/admin/static/css/namecard.css" /}
    <!--adminlte end-->
    <!-- BEGIN THEME LAYOUT STYLES -->
    {load href="/admin/static/bootstrap/plugins/layouts/layout/css/layout.min.css" /}
    {load href="/admin/static/adminlte/plugins/jQueryUI/jquery-ui.min.css" /}
    <!-- END THEME LAYOUT STYLES -->

    <!--[if lt IE 9]>
    {load href="/js/jquery-1.10.2.min.js" /}
    <![endif]--><!--[if gte IE 9]><!-->
    {load href="/js/jquery-2.0.3.min.js" /}
    {load href="/admin/static/js/jquery.mousewheel.js" /}
    <!--<![endif]-->
    {block name="style"}{/block}
    <script type="text/javascript">
        var ThinkPHP = window.Think = {
            "DOMAIN": "{:request()->root(true)}", //当前网站域名
            "ROOT": "__ROOT__", //当前网站地址
            "APP": "__APP__", //当前项目地址
            "PUBLIC": "__PUBLIC__", //项目公共目录地址
            "DEEP": "{:config('URL_PATHINFO_DEPR')}",
            "MODEL": ["{:config('URL_MODEL')}", "{:config('URL_CASE_INSENSITIVE')}", "{:config('URL_HTML_SUFFIX')}"],
            "VAR": ["{:config('VAR_MODULE')}", "{:config('VAR_CONTROLLER')}", "{:config('VAR_ACTION')}"],
            'URL_MODEL': "{:config('URL_MODEL')}"
        }
        var _ROOT_ = "__ROOT__";
        var _DOMAIN_ = "{:request()->root(true)}";
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <header class="main-header">
        <!-- Logo -->
        <a href="{:url('admin/Index/index')}" class="logo">
            <img style="height: 50px;margin-top: -6px" src="__PUBLIC__admin/static/images/logo.png" alt="logo" class="logo-default">
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <div class="collapse navbar-collapse navbar-collapse-example">
                <ul class="nav navbar-nav top-menu">
                    {volist name="__MENU__.main" id="menu"}
                        {neq name="menu.hide" value="1"}
                            <li data-id="{$menu.id}" class="mega-menu-dropdown {$menu.class|default=''}">
                                <a href="{$menu.url|url}" class="dropdown-toggle " data-hover="dropdown"
                                   data-close-others="true">
                                    {neq name="menu.icon" value=""}<i class="icon-{$menu.icon}"></i>&nbsp; {/neq}
                                    {$menu.title}
                                    <i class="fa fa-angle-down"></i>
                                </a>
                                <ul class="dropdown-menu" style="min-width: 700px;">
                                    <li>
                                        <!-- Content container to add padding -->
                                        <div class="mega-menu-content">
                                            <div class="row">
                                                {php}$k=0;{/php}
                                                {volist name="menu.children" id="children"}
                                                    {php}
                                                        $k++;
                                                        if(($k%4)==1){
                                                        $style="clear:left";
                                                        }else{
                                                        $style="";
                                                        }
                                                    {/php}
                                                    <div class="col-md-3" style="{$style}">
                                                        <ul class="mega-menu-submenu">
                                                            <li><h3>{$key}</h3></li>
                                                            {volist name="children" id="child"}
                                                                <li>
                                                                    <a href="{$child.url|url}">{$child.title}</a>
                                                                </li>
                                                            {/volist}
                                                        </ul>
                                                    </div>
                                                {/volist}
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </li>
                        {/neq}
                    {/volist}
                </ul>
                <ul class="nav navbar-nav navbar-right">
{if condition="is_administrator()"}
                    <li><a href="javascript:;" onclick="clear_cache()"><i class="icon-trash"></i> {:lang('_CACHE_CLEAR_')}</a>
                    </li>
					{/if}
                  <!--  <li><a target="_blank" href="{:url('home/Index/index')}"><i class="icon-copy"></i>
                        {:lang('_FORESTAGE_OPEN_')}</a></li>
					-->
					{php}$user_auth = session('user_auth');
				     if(!empty($user_auth['mp_token'])){
				{/php}
					<li><a href="{:url('mpbase/Mpbase/index')}"><i class="icon-star"></i> {:session('user_auth.public_name')}</a></li>
					{php}}else{{/php}
					<li><a href="{:url('mpbase/Mpbase/index')}"><i class="icon-star"></i>{:lang('_CHOOSE_MP_')}</a></li>
					{php}}{/php}
                    <li class="dropdown" style="margin-right: 15px;">
{php}
                            $user = query_user(array('nickname', 'space_url', 'space_mob_url', 'avatar32', 'avatar64', 'avatar128', 'uid', 'reg_time'),is_login());
                        {/php}
                        <a style="padding: 13px 15px 12px" href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img  src="{$user.avatar32}" class="avatar-img  small-img">
                            {:session('user_auth.username')}
                        </a>
                        <ul class="dropdown-menu name-card" role="menu">
                            <div class="head-box">
                                <img src="{$user.avatar128}" class="avatar-img">
                                <p> {:session('user_auth.username')}
                                    <small>注册于{$user.reg_time|date="Y/m/d",###}</small>
                                </p>
                            </div>
                            <div class="btn-box">
                                <a href="{:url('User/updatePassword')}" class="btn">修改密码/昵称</a>
                                <a href="{:url('admin/Base/logout')}" class="btn pull-right">{:lang('_EXIT_')}</a>
                            </div>
                        </ul>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <!--<li style="  margin-right: 15px;">
                        <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                    </li>-->
                    <script>
                        function clear_cache() {
                            $.get('__ROOT__/cc.php');
                            toast.success("{:lang('_CACHE_CLEAR_SUCCESS_')}{:lang('_PERIOD_')}");
                        }
                    </script>
                </ul>
            </div>

        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">
                <li class="header">模块</li>

                {volist name="__MODULE_MENU__" id="v"}
                    {if condition="$v['is_setup'] AND $v['admin_entry'] AND $v['show_nav']"}
                        {notEmpty name="v.children"}
                            <li class="treeview">
                                <a href="{:url($v['admin_entry'])}" title="{$v.alias|text}">
                                    <i class="fa fa-{$v['icon']}"></i>
                                    <span>{$v.alias}</span>
                                </a>
                                <ul class="treeview-menu">
                                    {volist name="v.children" id="children"}
                                        <li class="heading">
                                            <h4 class="uppercase"><i class="fa fa-chevron-circle-down"></i> {$key}</h4>
                                        </li>
                                        {volist name="children" id="child"}
                                            <li><a href="{$child.url|url}"><i class="fa fa-circle-o"></i>
                                                {$child.title}</a></li>
                                        {/volist}
                                    {/volist}
                                </ul>
                            </li>
                            {else/}
                            <li>
                                <a href="{:url($v['admin_entry'])}" title="{$v.alias|text}">
                                    <i class="fa fa-{$v['icon']}"></i>
                                    <span>{$v.alias}</span>
                                </a>
                            </li>
                        {/notEmpty}

                    {/if}
                {/volist}
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" style="min-height: 900px;">
        <ul class="sub_menu">

            {notEmpty name="__MENU__.child"}
                <li class="treeview">

                    <ul class="treeview-menu">
                        {volist name="__MENU__.child" id="children"}
                            {notEmpty name="children"}
                                <li class="heading">
                                    <h4 class="uppercase"><i class="fa fa-chevron-circle-down"></i> {$key}</h4>
                                </li>
                                {volist name="children" id="child"}
                                    <li><a href="{$child.url|url}"><i class="fa fa-circle-o"></i>
                                        {$child.title}</a></li>
                                {/volist}
                            {/notEmpty}

                        {/volist}
                    </ul>
                </li>

            {/notEmpty}
        </ul>
        <div style="padding:10px;padding-left:0;padding-bottom:10px;left: 335px;position:absolute;right: 0;bottom: 0;top: 50px;overflow: auto">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                {block name="main-header"}{/block}
            </section>

            <!-- Main content -->
            <section class="content">
                <div id="main-content">


                    <div id="main" style="overflow-y:auto;overflow-x:hidden;">
                        {block name="nav"}
                            <!-- nav -->
                            {notempty name="_show_nav"}
                                <div class="breadcrumb">
                                    <span>{:lang('_YOUR_POSITION_')}{:lang('_COLON_')}</span>
                                    <assign name="i" value="1"/>
                                    {foreach name="_nav" item="v" key="k"}
                                        {if condition="$i eq count($_nav)"}
                                            <span>{$v}</span>
                                            {else/}
                                            <span><a href="{$k}">{$v}</a>&gt;</span>
                                        {/if}
                                        <assign name="i" value="$i+1"/>
                                    {/foreach}
                                </div>
                            {/notempty}
                            <!-- nav -->
                        {/block}

                        <div class="admin-main-container">
                            {block name="body"}{/block}
                        </div>

                    </div>
                </div>
            </section>
            <!-- /.content -->
        </div>

    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        {block name="main-footer"}{/block}
    </footer>

    <div class="control-sidebar-bg"></div>
</div>

<!--adminlte-->
    <!-- FastClick -->
{load href="/admin/static/adminlte/plugins/fastclick/fastclick.js" /}
{load href="/admin/static/adminlte/bootstrap/js/bootstrap.min.js" /}

{load href="/admin/static/bootstrap/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" /}
{load href="/admin/static/adminlte/dist/js/app.min.js" /}
{load href="/admin/static/bootstrap/plugins/bootstrap-toastr/toastr.min.css" /}
{load href="/admin/static/bootstrap/plugins/bootstrap-toastr/toastr.min.js" /}

{load href="/admin/static/adminlte/plugins/jQueryUI/jquery-ui.min.js" /}
<!--adminlte end-->
{load href="/admin/static/js/com/com.toast.class.js" /}
<!--upload-->
{load href="/js/ext/webuploader/js/webuploader.js"/}
{load href="/js/ext/webuploader/css/webuploader.css"/}
<!--uediter-->
{load href="/static/ueditor/ueditor.config.js" /}
{load href="/static/ueditor/ueditor.all.min.js"/}

<script type="text/javascript">
    (function () {
        var ThinkPHP = window.Think = {
            "DOMAIN": "{:request()->root(true)}", //当前网站域名
            "ROOT": "__ROOT__", //当前网站地址
            "APP": "__APP__", //当前项目地址
            "PUBLIC": "__PUBLIC__", //项目公共目录地址
            "DEEP": "{:config('URL_PATHINFO_DEPR')}", //PATHINFO分割符
            "MODEL": ["{:config('URL_MODEL')}", "{:config('URL_CASE_INSENSITIVE')}", "{:config('URL_HTML_SUFFIX')}"],
            "VAR": ["{:config('VAR_MODULE')}", "{:config('VAR_CONTROLLER')}", "{:config('VAR_ACTION')}"],
            'URL_MODEL': "{:config('URL_MODEL')}"
        }
    })();
</script>
{load href="/static/think.js" /}
{load href="/admin/static/js/common.js" /}

<script type="text/javascript">
    +function () {
        var $window = $(window), $subnav = $("#subnav"), url;
        $window.resize(function () {
            $("#main").css("min-height", $window.height() - 130);
        }).resize();

        // 导航栏超出窗口高度后的模拟滚动条
        var sHeight = $(".sidebar").height();
        var subHeight = $(".subnav").height();
        var diff = subHeight - sHeight; //250
        var sub = $(".subnav");
        if (diff > 0) {
            $(window).mousewheel(function (event, delta) {
                if (delta > 0) {
                    if (parseInt(sub.css('marginTop')) > -10) {
                        sub.css('marginTop', '0px');
                    } else {
                        sub.css('marginTop', '+=' + 10);
                    }
                } else {
                    if (parseInt(sub.css('marginTop')) < '-' + (diff - 10)) {
                        sub.css('marginTop', '-' + (diff - 10));
                    } else {
                        sub.css('marginTop', '-=' + 10);
                    }
                }
            });
        }
    }();
    highlight_subnav("{:url('Admin'.'/'. $Request.controller .'/'. $Request.action ,$_GET)}")

    function displaySubMenu(li) {
        var subMenu = li.getElementsByTagName("ul")[0];
        subMenu.style.display = "block";
    }
    function hideSubMenu(li) {
        var subMenu = li.getElementsByTagName("ul")[0];
        subMenu.style.display = "none";
    }
</script>
{block name="script"}{/block}
{block name="modal"}{/block}
</body>
</html>
